feat: add asset picker opened and selected metrics#7575
feat: add asset picker opened and selected metrics#7575ghgoodreau wants to merge 8 commits intomainfrom
Conversation
| this.#priceDataSource.assetsMiddleware, | ||
| ], | ||
| const { response: enrichedResponse } = await this.#executeMiddlewares( | ||
| [this.#detectionMiddleware, this.#tokenDataSource, this.#priceDataSource], |
There was a problem hiding this comment.
handleAssetsUpdate ignores isBasicFunctionality for enrichment middlewares
Medium Severity
handleAssetsUpdate always runs TokenDataSource and PriceDataSource enrichment middlewares regardless of isBasicFunctionality(). In contrast, getAssets correctly excludes these API-based sources when basic functionality is off (RPC-only mode). This means when an RPC data source pushes a balance update via its subscription callback, the enrichment path still makes external API calls for token metadata and prices, violating the RPC-only contract that isBasicFunctionality is meant to enforce.
Additional Locations (1)
| handleBasicFunctionalityChange(_isBasic: boolean): void { | ||
| this.#stop(); | ||
| this.#subscribeAssets(); | ||
| } |
There was a problem hiding this comment.
handleBasicFunctionalityChange skips immediate data refresh unlike #start
Medium Severity
handleBasicFunctionalityChange calls #stop() then #subscribeAssets(), but unlike #start() it does not call getAssets(..., { forceUpdate: true }). When the user toggles basic functionality (e.g., switching from RPC-only to full API mode), subscriptions are recreated with the correct data source set, but no immediate fetch is triggered. Users see stale data from the previous mode until the next polling cycle fires.


Explanation
References
Checklist
Note
High Risk
Includes breaking API/state changes (
assetsMetadata→assetsInfo, AI digest actions removed) and substantial behavior changes in asset fetching/subscriptions that can affect downstream clients and persisted state.Overview
Upgrades the monorepo’s Jest toolchain to v29 (switching
scripts/tests frombabel-jesttots-jest, addinguuidmapping, updating depcheck ignores) and bumps many packages’ dev deps accordingly, plus increases ESLint memory for CI stability.Extends
@metamask/assets-controllerwith new data/state and runtime behavior toggles: renamesassetsMetadata→assetsInfo(breaking), adds RPC-only vs API-enabled mode viaisBasicFunctionality+ subscription refresh, introduces aStakedBalanceDataSourceto merge staked balances, and adds atrackMetaMetricsEventcallback that reports first post-unlock fetch duration (including per-data-source timing).Updates
@metamask/ai-controllersto focus on market insights: replaces legacy digest APIs/state/actions withfetchMarketInsightsbacked bysearchDigest(caip19Id), adds CAIP-19 validation, normalizes/validates API responses (including digest-envelope format), and adjusts caching/eviction behavior and tests.Written by Cursor Bugbot for commit e2f5d96. This will update automatically on new commits. Configure here.